﻿using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace WebHome_API.Migrations
{
    /// <inheritdoc />
    public partial class UpdateData001 : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropPrimaryKey(
                name: "PK_Gal_Table",
                table: "Gal_Table");

            migrationBuilder.RenameTable(
                name: "Gal_Table",
                newName: "Gals");

            migrationBuilder.AddPrimaryKey(
                name: "PK_Gals",
                table: "Gals",
                column: "ID");

            migrationBuilder.CreateTable(
                name: "GalTags",
                columns: table => new
                {
                    ID = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Title = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    IsDel = table.Column<int>(type: "int", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_GalTags", x => x.ID);
                });
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "GalTags");

            migrationBuilder.DropPrimaryKey(
                name: "PK_Gals",
                table: "Gals");

            migrationBuilder.RenameTable(
                name: "Gals",
                newName: "Gal_Table");

            migrationBuilder.AddPrimaryKey(
                name: "PK_Gal_Table",
                table: "Gal_Table",
                column: "ID");
        }
    }
}
